<html><head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>库存剩余</title>
   <#assign base=request.contextPath  />
    <link rel="stylesheet" href="${base}/js/layui/css/layui.css" media="all">
    <script type="text/javascript" src="${base}/js/zhang.js"></script>

</head>

<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
    <legend>库存剩余</legend>
</fieldset>

<table class="layui-hide" id="kcsy" lay-filter="user"></table>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">库存不足</a>
</script>

<script src="${base}/js/jquery.min.js"></script>
<script src="${base}/js/layui/layui.js"></script>
<script>


    layui.use('table', function(){
        var table = layui.table;

        table.render({
            elem: '#kcsy'
            ,url: '${base}/stock/selectStock'
            ,toolbar: '#toolbarDemo'
            ,defaultToolbar: ['filter', 'print', 'exports']
            ,cols: [[
                {field:'id', templet:function(val){
                        return val.LAY_INDEX
                    }, title: '序号',align:'center'}
                ,{field:'itemName',title: '物品名称',align:'center'}
                ,{field:'type', title: '物品种类',align:'center'}
                ,{field:'number', title: '数量' ,align:'center'}
                ,{field:'specifications', title: '规格' ,align:'center'}

                ,{field:'updatetime', title: '最后修改日期',templet:function(val){
                        return changeDateFormat(val.updatetime);
                    },align:'center'}
            ]]
            ,id: 'testReload'
            ,height:'600'
            ,page: {
                layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
                ,theme: '#0092EF'
            }
            ,done: function(res, curr, count){
                this.where={};
            }
        });
    });
    function Submit2(){
        var valu={};
        valu.type=$("#type").val();
        valu.number=$("#number").val();
        valu.itemName=$("#itemName").val();
        valu.price=$("#price").val();
        valu.updatetime=$("#updatetime").val();
        valu.Specifications=$("#Specifications").val();
        $.ajax({
            type : "POST", //提交方式
            url : "${base}/picking/insert",//路径
            //实体类       自己定义
            data:{"param":JSON.stringify(valu)},
            success : function(data) {//返回数据根据结果进行相应的处理
                var table = layui.table;
                //表刷新方法
                table.reload('testReload', {
                    url: '${base}/pick/pick'
                    ,where: {} //设定异步数据接口的额外参数
                    //,height: 300
                });
                $(".cangku").hide(200)
            }
        });
    }

</script>

</body>
</html>